package IO;

import java.io.*;

//对象输入流
public class OISDemo {
    public static void main(String[] args) throws IOException, ClassNotFoundException {
        //person.obj文件中的对象反序列化
        FileInputStream fis = new FileInputStream("person.obj");
        ObjectInputStream ois = new ObjectInputStream(fis);
        //对象输入流有个反序列化操作：Object readObject();
        Person p = (Person) ois.readObject();
        System.out.println(p);
        ois.close();

    }
}
